package com.yuyou.train.user.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.yuyou.train.service.api.user.dto.MyCommentPageDTO;
import com.yuyou.train.service.api.user.dto.UserCommentPageDTO;
import com.yuyou.train.service.api.user.dto.UserLessonCommentDTO;
import com.yuyou.train.service.api.user.entity.UserComment;
import com.yuyou.train.util.bean.Pagination;

@Mapper
public interface UserCommentMapper {
    int deleteByPrimaryKey(String id);

    int deleteByParentId(@Param(value = "parentId") String id);

    int insert(UserComment record);

    UserComment selectByPrimaryKey(String id);

    int updateByPrimaryKeySelective(UserComment record);
    
    List<UserLessonCommentDTO> findUserComment(UserComment record);

    List<UserCommentPageDTO> findUserCommentPageList(Pagination<UserCommentPageDTO> p);
    
    int findUserCommentPageCount(Pagination<UserCommentPageDTO> p);

    int findUserLessonCommentPageCount(Pagination<UserLessonCommentDTO> p);

    List<UserLessonCommentDTO> findUserLessonCommentPageList(Pagination<UserLessonCommentDTO> p);

    Integer sumStar(Pagination<UserCommentPageDTO> p);
    
    List<UserComment> finduserCommentLimit(@Param(value="foreignId") String foreignId, @Param(value="start") int start,@Param(value="limit") int limit);

    int findMyCommentPageCount(Pagination<MyCommentPageDTO> p);

    int findCommentOnMePageCount(Pagination<MyCommentPageDTO> p);

    List<MyCommentPageDTO> findCommentOnMePage(Pagination<MyCommentPageDTO> p);

    List<MyCommentPageDTO> findMyCommentPage(Pagination<MyCommentPageDTO> p);
    
    Long countByForeignId(String foreignId);
    
    
}